#!/bin/bash

projectPath=$(pwd)
scriptPath=$(cd $(dirname $0) && pwd)
projectName="${projectPath##*/}"

# GOOS：目标平台的操作系统（darwin、freebsd、linux、windows）
# GOARCH：目标平台的体系架构（386、amd64、arm）

# darwin
# CGO_ENABLED=0 GOOS=darwin GOARCH=386 go build
# mv ${projectName} ${projectName}_darwin_386
# CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build
# mv ${projectName} ${projectName}_darwin_amd64
# CGO_ENABLED=0 GOOS=darwin GOARCH=arm go build
# mv ${projectName} ${projectName}_darwin_arm

# freebsd
# CGO_ENABLED=0 GOOS=freebsd GOARCH=386 go build
# mv ${projectName} ${projectName}_freebsd_386
# CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build
# mv ${projectName} ${projectName}_freebsd_amd64
# CGO_ENABLED=0 GOOS=freebsd GOARCH=arm go build
# mv ${projectName} ${projectName}_freebsd_arm

# linux
# CGO_ENABLED=0 GOOS=linux GOARCH=386 go build
# mv ${projectName} ${projectName}_linux_386
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
mv ${projectName} ${projectName}_linux_amd64
CGO_ENABLED=0 GOOS=linux GOARCH=arm go build
mv ${projectName} ${projectName}_linux_arm

# windows
# CGO_ENABLED=0 GOOS=windows GOARCH=386 go build
# mv ${projectName} ${projectName}_windows_386
# CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build
# mv ${projectName} ${projectName}_windows_amd64
# CGO_ENABLED=0 GOOS=windows GOARCH=arm go build
# mv ${projectName} ${projectName}_windows_arm
